package com.itluma.myshopping.servlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 飞鸟
 * @create 2021-03-15 10:31
 * /模块名称？action=操作
 *
 * /product?action=add
 */
@WebServlet(value = "/product")
public class ProductServlet extends BaseServlet {

    public ProductServlet(){
        System.out.println("ProductServlet对象被构造成功了！");

    }
    public String show(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("Product--show()");
        return "redirect:/xxxx";
    }

    public String add(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("Product--add()");
        request.setAttribute("list", "数据");
        return "forward:/xxx";
    }

    public String update(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("Product--update()");
        return "value";
    }

    public void delete(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("Product--delete()");
    }
}

